app.controller("z-salaryRequestDetail-c",['$scope','$rootScope','$z-http','$sce','z-salaryDetail-s','$filter','$location',
    function($scope,$rootScope,$zhttp,$sce,Service,$filter,$location){
	$scope.viewModel = {};
	$scope.viewModel.perPage = "10";
	$scope.viewModel.rowCount = "1";
	$scope.detailModel={};
	$scope.detailModel.dataList=[];
	
	$scope.viewModel.bindData=function(salaryRequestId){
		$scope.viewModel.isLoading = true;
		Service.getSalaryListDetail(
			    {
			        salaryRequestId:salaryRequestId
			    },
			    function (data) {
			        $scope.detailModel.dataList = data;
			        $scope.viewModel.isLoading = false;
			    },
			    function (error) {
			        $rootScope.alertError(error.fault.message);
			        $scope.viewModel.isLoading = false;
			    });
	};
	
	var salaryRequestId=$location.search()['salaryRequestId'];
	//验证是否存在KEY
	if(!angular.isUndefined(salaryRequestId)){
		$scope.viewModel.bindData(salaryRequestId);
	}
    
	
} ]);